package com.dc.aimc.user.api;

import com.dc.aimc.common.service.response.JsonResponse;
import com.dc.aimc.user.entity.App;
import com.dc.aimc.user.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;


@Service
@FeignClient(value = "aimc-user")
public interface UserFeignClient {

    @GetMapping("user/user/{username}")
    JsonResponse<User> getUserByUsername(@PathVariable("username") String username);

    @GetMapping("user/user/{username}")
    JsonResponse<User> getUserByUsername(@PathVariable("username") String username, @RequestHeader("tenant-id") String tenantId);

    @GetMapping("app/app/{id}")
    JsonResponse<App> getAppByAppId(@PathVariable("id") String appId);

    @GetMapping("app/app/{id}")
    JsonResponse<App> getAppByAppId(@PathVariable("id") String appId, @RequestHeader("tenant-id") String tenantId);

}
